package com.alks.function.controller.pcFactoryQuery;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.factoryquery.CuttingPartRequest;
import com.alks.function.data.request.factoryquery.LotStyleRerquest;
import com.alks.function.service.pcfactoryquery.IPcCuttingLsPartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@ApiRestController("/pcFactorQuery")
@Api(value = "总经办", tags = "总经办-工厂查询模块-裁配账目查询")
@Slf4j
@RoleCheck(prgIds = {"100415","140207","160213","170512","110307","130306","180713","190210","210206"}
        ,methodName = {"queryCuttingPartBack"})
public class CutPartLsController {
    @Autowired
    private IPcCuttingLsPartService cutService;

    @PutMapping("/queryCuttingPartLsDetail")
    @ApiOperation(value = "裁配明细-条件查询",tags = "总经办-工厂查询模块-裁配账目查询")
    @WebLogger
    public ResponseInfo queryCuttingPartLsDetail(@Valid @RequestBody CuttingPartRequest request){return cutService.queryCuttingPartLsDetail(request);}

    @PutMapping("/queryCuttingPartLsLot")
    @ApiOperation(value = "选择指令-分页可条件查询",tags = "总经办-工厂查询模块-裁配账目查询")
    @WebLogger
    public ResponseInfo queryCuttingPartLsLot(@RequestBody LotStyleRerquest request){return cutService.queryCuttingPartLsLot(request);}

    @GetMapping("/queryCuttingPartLs/{lotNo}")
    @ApiOperation(value = "选择轮次-条件查询",tags = "总经办-工厂查询模块-裁配账目查询")
    @WebLogger
    public ResponseInfo queryCuttingPartLs(@PathVariable String lotNo){
        return ResponseInfo.ok(cutService.queryCuttingPartLs(lotNo));
    }

    @GetMapping("/queryCuttingPartLsBack")
    @ApiOperation(value = "裁配账目-裁配账目工艺-回表查询",tags = "总经办-工厂查询模块-裁配账目查询")
    @WebLogger
    public ResponseInfo queryCuttingPartBack(){return cutService.queryCuttingPartBack();}

}
